import Vue from 'vue';
import Router from 'vue-router';

// 主页面
const Main = r => require.ensure([], () => r(require('../views/main/index.vue')), 'Main');
// 测试页面
const Suanfakaifa = r => require.ensure([], () => r(require('../views/suanfakaifa/index.vue')), 'Suanfakaifa');
const Test1 = r => require.ensure([], () => r(require('../views/test1/index.vue')), 'Test1');
const Online = r => require.ensure([], () => r(require('../views/online/index.vue')), 'Online');
const Train = r => require.ensure([], () => r(require('../views/train/index.vue')), 'Train');


Vue.use(Router);

export default new Router({
  routes: [{
    path: '/',
    name: 'Main',
    component: Main,
    children: [{
        path: 'suanfakaifa',
        component: Suanfakaifa,
        name: Suanfakaifa
      },
      {
        path: 'test1',
        component: Test1,
        name: Test1
      },
      {
        path: 'online',
        component: Online,
        name: Online
      },
      {
        path: 'train',
        component: Train,
        name: Train
      },
    ]
  }, ]
});